package api

import (
	"github.com/spf13/cobra"
	"ssnotification/internal/notify"

	"ssnotification/common/constant"
)

var StartCmd = &cobra.Command{
	Use:          "server",
	Short:        "Start API server",
	Example:      "ssnotification server -c config/settings.yml",
	SilenceUsage: true,
	RunE: func(cmd *cobra.Command, args []string) error {
		return notify.Start()
	},
}

func init() {
	StartCmd.PersistentFlags().StringVarP(&constant.ConfigFile, "config", "c", "config/ssnotification.yml", "Start server with provided configuration file")
}
